#ifndef HISTORICALDATA_H
#define HISTORICALDATA_H

#include <QWidget>
#include <QtCharts>
#include <QVBoxLayout>
#include <QTimer>

#include "Models/DeviceData.h"

namespace Ui {
class HistoricalData;
}

class HistoricalData : public QWidget
{
    Q_OBJECT

public:
    explicit HistoricalData(QWidget *parent = nullptr);
    ~HistoricalData();

    void chart_temperature_init();
    void plotData(QVector<DeviceData*> data);
private slots:
    void on_pushButton_search_clicked();

private:
    Ui::HistoricalData *ui;

    QVBoxLayout* layout_temperature;
    QVBoxLayout* layout_humidity;

    QChart *chart_temperature;
    QLineSeries *series_temperature;
    QChartView *chartView_temperature;
    QDateTimeAxis* axisX_temperature;
    QValueAxis* axisY;

    void comBoxDeviceInit();
    void calendarInit();
};

#endif // HISTORICALDATA_H
